using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
using UserManagement.Services;
using UserManagement.Views;

namespace UserManagement
{
    public class UserManagementModule : IModule
    {
        public void OnInitialized(IContainerProvider containerProvider)
        {
            // 模块初始化后的操作
            var regionManager = containerProvider.Resolve<IRegionManager>();
            
            // 可以在这里注册视图到特定区域（如果需要默认显示某个视图）
            // regionManager.RegisterViewWithRegion("ContentRegion", typeof(UserListView));
        }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            // 注册服务
            containerRegistry.RegisterSingleton<IUserService, UserService>();

            // 注册视图用于导航
            containerRegistry.RegisterForNavigation<UserListView>();
            containerRegistry.RegisterForNavigation<AddUserView>();
        }
    }
}